<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once("db.php");

function add_data()
{
global $wpdb;
   $disaster = $wpdb->prefix . DISASTER_EVENTS_TABLE;


$rows_affected = $wpdb->insert( $disaster, array( 'location' => "Los Angeles",
				    'geocode' => "-104.0625 33.43144133557529", 'name' => "Earthquake",
				    'start_date' => "2011-03-10", 'description' => "Huge earthquake wiped out all power to the greater los angeles area, people are in need of basic supplies like water and food",
				    'shipping_address' => "123 N Hollywood Blvd, LA, 97xxx") );
				    
  $rows_affected = $wpdb->insert( $disaster, array( 'location' => "Japan",
				    'geocode' => "136.318359375 36.52729481454624", 'name' => "Tsunami",
				    'start_date' => "2011-03-10", 'description' => "Huge tusnami wiped out many costal towns leaving them without necessary supplies", 'shipping_address' => "123 N High St., Japan") );
				    
 $rows_affected = $wpdb->insert( $disaster, array( 'location' => "Granada",
				    'geocode' => "-3.603515625 37.160316546736745", 'name' => "Tornado",
				    'start_date' => "2011-07-08", 'description' => "Tornado touched down in the Albaicin, and destroyed much of the moorish district and injured many residents", 'shipping_address' => "1234 23rd Apartment # A3, Granada Spain") );
				    

   $name = $wpdb->prefix . SHIPMENTS_TABLE;

 $rows_affected = $wpdb->insert($name, array( 'event_id' => '1', 'date_sent' => '2011-03-10', 'date_received' => '2011-03-10') );
 
	$table_name = $wpdb->prefix . SUPPLIES_TABLE;
	
	 $wpdb->insert($table_name, array( 'event_id' => '1', 'shipment_id' => '1', 'type' => 'money', 'unit' => 'USD', 'amount_needed' => '10000') );

	$wpdb->insert($table_name, array( 'event_id' => '1', 'shipment_id' => '1', 'type' => 'food', 'unit' => 'kg', 'amount_needed' => '1000') );

		 $wpdb->insert($table_name, array( 'event_id' => '1', 'shipment_id' => '1', 'type' => 'water', 'unit' => 'L', 'amount_needed' => '1000') );

		 $wpdb->insert($table_name, array( 'event_id' => '1', 'shipment_id' => '1', 'type' => 'clothing', 'unit' => 'articles', 'amount_needed' => '500') );


	 $wpdb->insert($table_name, array( 'event_id' => '1', 'shipment_id' => '1', 'type' => 'tents', 'unit' => 'tents', 'amount_needed' => '150') );


// second shipment and supplies table

 $rows_affected = $wpdb->insert($name, array( 'event_id' => '2', 'date_sent' => '2011-04-15', 'date_received' => '2011-05-01') );


	 $wpdb->insert($table_name, array( 'event_id' => '2', 'shipment_id' => '2', 'type' => 'money', 'unit' => 'USD', 'amount_needed' => '50') );

	$wpdb->insert($table_name, array( 'event_id' => '2', 'shipment_id' => '2', 'type' => 'food', 'unit' => 'kg', 'amount_needed' => '100') );

		 $wpdb->insert($table_name, array( 'event_id' => '2', 'shipment_id' => '2', 'type' => 'bottled water', 'unit' => 'L', 'amount_needed' => '65') );

		 $wpdb->insert($table_name, array( 'event_id' => '2', 'shipment_id' => '2', 'type' => 'emergency blanket', 'unit' => 'blankets', 'amount_needed' => '500') );


 $rows_affected = $wpdb->insert($name, array( 'event_id' => '3', 'date_sent' => '2011-05-03', 'date_received' => '2011-05-07') );


	 $wpdb->insert($table_name, array( 'event_id' => '3', 'shipment_id' => '3', 'type' => 'building supplies', 'unit' => 'kg', 'amount_needed' => '50') );
	 
	 	 $wpdb->insert($table_name, array( 'event_id' => '3', 'shipment_id' => '3', 'type' => 'tools', 'unit' => 'kg', 'amount_needed' => '20') );
	 	 
	 	  $name = $wpdb->prefix . USER_CONTRIBUTIONS_TABLE;



	 	 $wpdb->insert($name, array( 'user_id' => '1', 'shipment_id' => '1', 'submission_date' => '2011-03-15', 'amount' => '50', 'type' => 'food', 'received' => '0') );
	 	 $wpdb->insert($name, array( 'user_id' => '2', 'shipment_id' => '1', 'submission_date' => '2011-03-20', 'amount' => '100', 'type' => 'water', 'received' => '0') );
	 	 $wpdb->insert($name, array( 'user_id' => '3', 'shipment_id' => '2', 'submission_date' => '2011-04-05', 'amount' => '20', 'type' => 'money', 'received' => '1') );
	 	 

	

}



?>